package com.cnap.multiclouldmgmt.repository.master;

import com.cnap.multiclouldmgmt.model.knowledge.ErrorInjectModel;
import com.cnap.multiclouldmgmt.model.knowledge.ErrorInjectSceneModel;
import com.cnap.multiclouldmgmt.model.knowledge.KnowledgePO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <类文件描述>
 *
 * @author xc
 **/
@Mapper
public interface KnowledgeMapper {

    /**
     * 查询所有
     *
     * @return 结果
     */
    List<KnowledgePO> selectAll();

    int getErrorInjectScenesNum( @Param("keyword")String keyword);

    List<ErrorInjectSceneModel> getErrorInjectScenes(@Param("keyword")String keyword, @Param("pageSize")int pageSize, @Param("offset")int offset);

    ErrorInjectModel getErrorInjectRecordByNameUser(@Param("errorName")String errorName, @Param("userName")String userName);

    void saveErrorInjectModel(ErrorInjectModel errorInjectModel);

    List<ErrorInjectModel> getErrorInjectRecordByPage(@Param("keyword")String keyword, @Param("offset")int offset, @Param("pageSize")int pageSize);

    int getErrorInjectRecordNum(@Param("keyword")String keyword);

    ErrorInjectModel getErrorInjectRecordById(@Param("id")int id);

    void delErrorInjectRecordById(@Param("id")int id);

    void changeErrorInjectRecordStatus(@Param("id")int id, @Param("newStatus")String newStatus);

    void changeErrorInjectRecordRunningId(@Param("id")int id, @Param("runingId")String runingId);
}
